<!-- original ssh tab content (commented out) -->
<!-- 固定侧边连接配置面板（默认隐藏，点击展开） -->
<div id="ssh-config-panel" class="card shadow-lg">
    <div class="card-header bg-info text-white d-flex justify-content-between align-items-center">
        <h2 class="h6 mb-0">
            <i class="fa fa-cog mr-2"></i>连接配置
        </h2>
        <button id="ssh-config-close" class="btn btn-light btn-sm" title="隐藏">
            <i class="fa fa-angle-left"></i>
        </button>
    </div>
    <div class="card-body">
        <!-- 多服务器列表 -->
        <div class="d-flex justify-content-between align-items-center mb-2">
            <h3 class="h6 mb-0"><i class="fa fa-server me-1"></i>服务器列表</h3>
            <button id="ssh-add-server-btn" class="btn btn-sm btn-success" title="新增服务器" data-bs-toggle="modal"
                data-bs-target="#sshAddServerModal"><i class="fa fa-plus"></i> 新增</button>
        </div>
        <div id="ssh-server-list" class="list-group mb-3" style="max-height: 40vh; overflow:auto;">
            <div class="text-center text-muted p-2"><i class="fa fa-spinner fa-spin"></i> 加载中...</div>
        </div>
        <form id="ssh-connect-form">
            <div class="mb-3">
                <label for="ssh-host" class="form-label">主机地址</label>
                <input type="text" class="form-control" id="ssh-host" placeholder="例如: 192.168.1.1"
                    value="192.168.137.26" required>
            </div>
            <div class="mb-3">
                <label for="ssh-port" class="form-label">端口</label>
                <input type="number" class="form-control" id="ssh-port" value="22" min="1" max="65535" required>
            </div>
            <div class="mb-3">
                <label for="ssh-username" class="form-label">用户名</label>
                <input type="text" class="form-control" id="ssh-username" placeholder="输入用户名" value="root" required>
            </div>
            <div class="mb-3">
                <label for="ssh-password" class="form-label">密码</label>
                <input type="password" class="form-control" id="ssh-password" placeholder="输入密码" value="123456">
            </div>
            <button type="submit" class="btn btn-primary w-100" id="ssh-connect-btn">
                <i class="fa fa-plug mr-1"></i>连接
            </button>
            <button type="button" class="btn btn-secondary w-100 mt-2" id="ssh-disconnect-btn" disabled>
                <i class="fa fa-unplug mr-1"></i>断开连接
            </button>
        </form>
    </div>
</div>
<div class="row">
    <!-- 终端区域占满宽度 -->
    <div class="col-12">
        <div class="card shadow-sm">
            <div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
                <h2 class="h5 mb-0">
                    <i class="fa fa-terminal mr-2"></i>SSH终端
                </h2>
                <div class="d-flex align-items-center">
                    <!-- 会话信息整合到卡片头部 -->
                    <div id="ssh-connection-status" class="me-2 d-flex align-items-center">
                        <span class="badge bg-danger text-white">未连接</span>
                    </div>
                    <div id="ssh-current-host" class="text-white me-3 d-flex align-items-center" style="display: none;">
                        <i class="fa fa-server me-1"></i>
                        <span>--</span>
                    </div>
                    <div id="ssh-current-user" class="text-white me-3 d-flex align-items-center" style="display: none;">
                        <i class="fa fa-user me-1"></i>
                        <span>--</span>
                    </div>
                    <span id="terminal-status" class="badge bg-danger text-white me-2">
                        未连接
                    </span>
                    <!-- 展开/隐藏连接配置面板按钮 -->
                    <button id="ssh-config-toggle" class="btn btn-light btn-sm me-2" title="展开连接配置">
                        <i class="fa fa-sliders"></i>
                    </button>
                    <!-- 终端尺寸切换按钮 -->
                    <button id="ssh-size-btn" class="btn btn-light btn-sm" title="切换终端尺寸">
                        <i id="ssh-size-icon" class="fa fa-expand"></i>
                    </button>
                    <!-- 文件管理按钮（打开SFTP弹窗） -->
                    <button id="ssh-file-btn" class="btn btn-light btn-sm ms-2" title="文件管理" data-bs-toggle="modal"
                        data-bs-target="#sftpModal">
                        <i class="fa fa-folder-open"></i>
                    </button>
                </div>
            </div>
            <div class="card-body p-0">
                <div id="terminal-container" style="height: calc(100vh - 140px); background-color: #000;">
                    <!-- xterm.js终端将在这里初始化 -->
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end original ssh tab content -->